<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../taglibs.jsp"%>
<%@ include file="../easyuiLib.jsp"%>
<%@page import="com.carnation.utils.MenuRead"%>
<%@page import="com.carnation.bean.Menu"%>
<%
	MenuRead menuRead = new MenuRead();
	Menu menu = menuRead.getMenuById(request.getParameter("id"));
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" charset="utf-8">
	function modify(){
		$('#modfiyForm').form('submit',{
			url : '${ctx}/ModMenu',
			onSubmit : function(){
				return $('#modfiyForm').form('validate');
			},
			success:function(data){
				var json = JSON.parse(data);
				window.parent.refresh();
				$.messager.alert("结果",json.msg);
			}
		});
	}
</script>
</head>
<body>
	<div class="easyui-panel" fit="true" style="overflow: hidden;"
		title="菜单">
		<div>
			<table border="1" style="width:100%; height: 100px;">
				<tr>
					<th>编号</th>
					<th>名称</th>
					<th>图标</th>
					<th>URL</th>
					<th>功能</th>
				</tr>
				<tr>
					<td><span><%=menu.getId()%></span></td>
					<td><span><%=menu.getName()%></span></td>
					<td><span><%=menu.getIcon()%></span></td>
					<td><span><%=menu.getUrl()%></span></td>
					<td><span>1.修改菜单</span></td>
				</tr>
			</table>
		</div>
		<div id="modifyPanel" class="easyui-panel" title="修改菜单">
			<form id="modfiyForm" method="post">
				<table>
					<tr style="display:none;">
						<th><span>类型:</span></th>
						<td><input type="text" value="menu" readonly="true" name="type"/></td>
					</tr>
					<tr style="display:none;">
						<th><span>编号:</span></th>
						<td><input type="text"  value="<%=menu.getId() %>" readonly="true" name="id"/></td>
					</tr>
					<tr>
						<th><span>名称:</span></th>
						<td><input class="easyui-validatebox textbox" data-options="required:true" value="<%=menu.getName() %>"  name="name"/></td>
					</tr>
					<tr>
						<th><span>图标:</span></th>
						<td><input class="easyui-validatebox textbox" data-options="required:true" value="<%=menu.getIcon() %>" name="icon" /></td>
					</tr>
					<tr>
						<td></td>
						<td><a class="easyui-linkbutton" onclick="modify()">修改</a></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>